package com.htstar.ovms.job.job;

import com.htstar.ovms.common.core.constant.SecurityConstants;
import com.htstar.ovms.device.api.feign.DeviceLastDataFeign;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import com.xxl.job.core.log.XxlJobLogger;
import com.xxl.job.core.util.ShardingUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import static com.xxl.job.core.biz.model.ReturnT.SUCCESS;


@Slf4j
@Component
public class DeviceChecker {


    @Autowired
    DeviceLastDataFeign deviceLastDataFeign;

    @XxlJob("DeviceCheckerHandler")
    public ReturnT<String> demoJobHandler(String s) {
        System.out.println("SUCCESS-START");
        try {
            deviceLastDataFeign.deviceCheck(SecurityConstants.FROM_IN);
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println("SUCCESS-END");
        return SUCCESS;
    }



}
